package com.yonyou.marketing.app.api.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.yonyou.gmmc.common.annotation.OracleDb;
import com.yonyou.marketing.app.api.dto.CarInfoDTO;
import com.yonyou.marketing.app.api.dto.CarOwnerDto;
import com.yonyou.marketing.app.api.model.CarInfoPO;
import com.yonyou.marketing.app.api.model.TmCarOwner;
import com.yonyou.marketing.app.api.model.UserDataDTO;

import tk.mybatis.mapper.common.Mapper;
@OracleDb
public interface TmCarOwnerMapper extends Mapper<TmCarOwner> {
	
	/**
	 * 根据手机号查询openId
	 * @param phone
	 * @return
	 */
	public List<String> selectOpenIdByPhone(@Param("phone") String phone);
	
	public String selectPhoneByUserId(@Param("userId") Integer userId);
	
	public Integer selectUserIdByPhone(@Param("phone") String phone);
	
	public List<CarInfoDTO> selectCarInfo(@Param("vin") String vin);

    public List<CarInfoPO> selectCarInfoList(@Param("userId") Integer userId,@Param("carId") Integer carId);
    
    public List<UserDataDTO> selectCarInfoByUserId(@Param("userId") Integer userId);

    public String selectOpenIdByUserId(@Param("userId") Integer userId);
    
    public Integer selectPotentialIdByUserId(@Param("userId") Long userId);
    
    public List<CarOwnerDto> selectUserInfo(@Param("userId") String userId);
    
    public String countOwnerCar(@Param("userId") String userId);
    
    public Integer selectCountByPhone(@Param("phone") String phone);
    
    public void insertTrUserOwner(@Param("userId") Integer userId,@Param("potentialId") Long potentialId);
}